/*
 * Copyright 2003-2005 (c) Live Media Pty Ltd. <argot@einet.com.au> 
 *
 * This software is licensed under the Argot Public License 
 * which may be found in the file LICENSE distributed 
 * with this software.
 *
 * More information about this license can be found at
 * http://www.einet.com.au/License
 * 
 * The Developer of this software is Live Media Pty Ltd,
 * PO Box 4591, Melbourne 3001, Australia.  The license is subject 
 * to the law of Victoria, Australia, and subject to exclusive 
 * jurisdiction of the Victorian courts.
 */

#include "intmap.h"



int main()
{
	intmap * im = intmap_create(3);
	
	printf("size = %i\n", intmap_size(im));	
	intmap_add(im, 10,12 );
	intmap_add(im, 11,14 );
	printf("size = %i\n", intmap_size(im));
	intmap_find(im, 10 );
	printf("key = %i\n", intmap_key(im));
	printf("value = %i\n", intmap_value(im));
	printf("value = %i\n", intmap_find_value(im,10));
	
	intmap_find_key(im, 14 );
	printf("key = %i\n", intmap_key(im));
	printf("value = %i\n", intmap_value(im));
	printf("value = %i\n", intmap_find_key_value(im, 14));
	
	intmap_remove(im);
	printf("size = %i\n", intmap_size(im));
	
	if ( intmap_find_key(im, 10 ) == INTMAP_OK )
	{
		printf("key = %i\n", intmap_key(im));
		printf("value = %i\n", intmap_value(im));
	}
	int rc = intmap_find(im, 11);
	if ( rc == INTMAP_ERROR )
	{
		printf("key not found");
	}
	else if ( rc == INTMAP_OK )
	{
		printf("found!");
	}
	
	rc = intmap_find(im, 14);
	if ( rc == INTMAP_ERROR )
	{
		printf("key not found");
	}
	else if ( rc == INTMAP_OK )
	{
		printf("found!");
	}	
	intmap_destroy(im);
	
	return 0;
}

